<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>梯形示例</title>
  <style>
    .rectangle {
      width: 200px;
      height: 100px;
      position: relative;
      background-color: #ccc;
    }

    .left-trapezoid,
    .right-trapezoid {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 50%;
      height: 100%;
    }

    .left-trapezoid {
      left: 0;
      background:
              linear-gradient(to bottom right, transparent 49%, #FF5733 49%, #FF5733 51%, transparent 51%),
              #FF5733; /* 橙色 */
    }

    .right-trapezoid {
      right: 0;
      background:
              linear-gradient(to bottom left, transparent 49%, #33FF57 49%, #33FF57 51%, transparent 51%),
              #33FF57; /* 绿色 */
    }
  </style>
</head>
<body>
<div class="rectangle">
  <div class="left-trapezoid"></div>
  <div class="right-trapezoid"></div>
</div>
</body>
</html>
